import random
import string

def rand(len=8, is_num=True, is_lower=True, is_upper=False, is_special=False):
    if len < 1:
        return None

    numric = '0123456789'
    low = 'abcdefghijklmnopqrstuvwxyz'
    upp = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    spec = '~!@#$%^&*()[]{}_=+-'

    str = ''

    if is_num:
        str += numric
    if is_lower:
        str += low
    if is_upper:
        str += upp
    if is_special:
        str += spec
    
    if str == '':
        str = num + low

    return string.join(random.sample(str, len)).replace(' ', '')

def randHotKey():
    key = ['and','import','not','raise','assert','def','from','in','or','del','exec','global','is','pass','try','elif','lambda','print','while','asm','auto','bool','break','case','catch','char','class','const','continue','default','delete','do','double','else','enum','except','explicit','extern','false','finally','float','for','friend','goto','if','inline','int','long','mutable','namespace','new','operator','private','protected','public','register','return','short','signed','sizeof','static','struct','switch','template','this','throw','true','typedef','typeid','typename','union','unsigned','using','virtual','void','volatile']
    return random.choice (key)

if __name__ == '__main__':
    pass